home *** CD-ROM | disk | FTP | other *** search
- unit UPTFrame; // Copyright ⌐ 1996-2001 Plasmatech Software Design. All rights reserved.
- {
- Shell Control Pack
- Version 1.6
-
- Implements controls that frame a screen region with one of 11 different styles.
- TPTGroup is a windowed control that can be the parent of other controls. It works
- like a group box but with a choice of frame styles. TPTFrame is non-windowed and
- cannot be the parent of other controls - although sibling controls can be placed
- over TPTFrame.
-
- You should choose the control that is most applicable to each situation. If you need
- to contain other controls (as in a groupbox), use TPTGroup. If you are mearly framing
- a screen region then you might use TPTFrame. Being non-windowed TPTFrame uses much
- fewer resources (and no window handles) compared with TPTGroup.
-
- The Draw* functions used to draw the frames are exposed, so you can draw similar
- frames anywhere you want. Many Plasmatools components use these exposed Draw*
- functions to provide embedded frame functionality.
-
- History
- ===================================================================================================
- V1.6 2Jul01 Delphi 6 release, no changes.
- V1.5c 30Mar01 No changes.
- V1.5b 12Dec00 No changes.
- V1.5a 14May00 No changes.
- V1.5 3Mar00 C++Builder 5 support, no changes.
- V1.4a 15Dec99 Published OnContextPopup for Delphi 5.
- V1.4 14Sep99 No changes.
- V1.3h 29Mar99 No changes.
- V1.3g 1Dec98 No changes.
- V1.3f 12Jul98 Added WEAKPACKAGEUNIT directive.
- Added Delphi 4 properties.
- Fixed problem with TabOrder - now published.
- V1.3e 22Apr98 No changes.
- V1.3d 18Apr98 No changes.
- V1.3c 16Mar98 C++Builder 3 support.
- Added DefaultDrawing property and OnPaint event to TPTGroup.
- V1.3b 7Feb98 Added compiler directives.
- V1.3a 7Jan98 Fixed flicker problem with TPTGroup (D3 only) - especially when used
- in splitter controls.
- The border is now a true non-client area - see WM_NCCALCSIZE and WM_NCPAINT.
- Added TPTCustomGroup.EnableAllChildren method.
- V1.3 28Nov97 No changes.
- V1.2b 12Oct97 No changes.
- V1.2a 5Oct97 No changes.
- V1.2 6Sep97 Removed package warnings.
- Added TPTCustomFrame and TPTCustomGroup base classes.
- Fixed OnClick and OnDblClick properties of TPTFrame and TPTGroup.
- V1.1a 6Jul97 No changes.
- V1.1 26Jun97 No changes.
- V1.0c 31May97 No changes.
- V1.0b 17May97 Delphi 3 support.
- V1.0a 1May97 No changes.
- V1.0 21Apr97 Released version 1.0
- }
-
- {$INCLUDE PTCompVer.inc}
-
- {$RANGECHECKS OFF} {$OVERFLOWCHECKS OFF} {$WRITEABLECONST OFF}
- {$BOOLEVAL OFF} {$EXTENDEDSYNTAX ON} {$TYPEDADDRESS ON}
-
- {$IFDEF VCL30PLUS}
- {$WEAKPACKAGEUNIT}
- {$ENDIF}
-
- interface
- uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
-
- type TPTFrameStyle = ( ptfsNone, ptfsGroup, ptfsLowered, ptfsRaised, ptfsDint, ptfsBump,
- ptfsSingle, ptfsHorzLine, ptfsHorzEdge, ptfsVertLine, ptfsVertEdge );
-
- TPTFramePaintEvent = procedure( aSender: TObject; aCanvas: TCanvas ) of object;
-
- TPTCustomGroup = class(TCustomControl)
- public
- constructor Create( aOwner: TComponent ); override;
- procedure EnableAllChildren( afEnable: Boolean );
- end; {TPTCustomGroup}
-
-
- TPTGroup = class(TPTCustomGroup)
- published
- property Alignment;
- property DefaultDrawing;
- property FrameSpace;
- property FrameStyle;
- //
- property Align;
- property Caption;
- property Color;
- property Font;
- property Enabled;
- property ParentColor;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Visible;
- property Width;
- property Height;
- property TabOrder;
- //
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnEnter;
- property OnExit;
- property OnPaint;
-
- {$IFDEF VCL40PLUS}
- property Anchors;
- property BiDiMode;
- property BorderWidth;
- property Constraints;
- property ParentBiDiMode;
- property UseDockManager;
- property OnCanResize;
- property OnConstrainedResize;
- {$ENDIF}
- {$IFDEF VCL50PLUS}
- property OnContextPopup;
- {$ENDIF}
- end; {TPTGroup}
-
-
- TPTCustomFrame = class(TGraphicControl)
- public
- constructor Create( aOwner: TComponent ); override;
- end; {TPTCustomFrame}
-
-
- TPTFrame = class(TPTCustomFrame)
- published
- property Alignment;
- property DefaultDrawing;
- property FrameSpace;
- property FrameStyle;
- property OnPaint;
- //
- property Align;
- property Caption;
- property Color;
- property Font;
- property ParentColor;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Visible;
- property Width;
- property Height;
- //
- property OnClick;
- property OnDblClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
-
- {$IFDEF VCL40PLUS}
- property Anchors;
- property BiDiMode;
- property Constraints;
- property ParentBiDiMode;
- property OnCanResize;
- property OnConstrainedResize;
- {$ENDIF}
- {$IFDEF VCL50PLUS}
- property OnContextPopup;
- {$ENDIF}
- end;
-
-
-
- procedure DrawBumpFrame( c: TCanvas; const r: TRect );
- procedure DrawDintFrame( c: TCanvas; const r: TRect );
- procedure DrawGroupFrame( c: TCanvas; const ar: TRect; const caption: String; color: TColor; enabled: Boolean );
- procedure DrawHorzEdge( c: TCanvas; const r: TRect; c1, c2: TColor );
- procedure DrawHorzLine( c: TCanvas; const r: TRect; c1, c2: TColor );
- procedure DrawLoweredFrame( c: TCanvas; const r: TRect );
- procedure DrawRaisedFrame( c: TCanvas; const r: TRect );
- procedure DrawSingleFrame( c: TCanvas; const r: TRect );
- procedure DrawVertEdge( c: TCanvas; const r: TRect; c1, c2: TColor );
- procedure DrawVertLine( c: TCanvas; const r: TRect; c1, c2: TColor );
-
- procedure DrawFrame( fs: TPTFrameStyle; c: TCanvas; const r: TRect );
-
- procedure AdjustRectForFrame( fs: TPTFrameStyle; var r: TRect );
-
- {*********************************************************}
- implementation
-